package com.ttloner.admin.config;

import com.ttloner.admin.interceptor.LoginInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author TTLoner
 * @date 2021/7/20 21:04
 * @description
 */
//将拦截器加入组件中
@Configuration
public class AdminWebConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new LoginInterceptor())
                .addPathPatterns("/**")
                .excludePathPatterns("/","/login","/regist","/css/**","/fonts/**","/images/**","/js/**","/main");
    }
}
